package com.mrlv.redis.select;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * Redis 切换DB配置
 */
public class RedisSelectSupport {
    private static final TransmittableThreadLocal<Integer> SELECT_CONTEXT = new TransmittableThreadLocal<>();

    public static void select(int db){
        SELECT_CONTEXT.set(db);
    }

    public static Integer getSelect(){
        return SELECT_CONTEXT.get();
    }
}